package chen.web.firewall;

import javax.servlet.Filter;
import javax.servlet.http.HttpServletRequest;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import chen.web.MyContext;
import chen.web.MyContextProvider;

public class UuidFilter extends AbstractFilter<UuidTable> implements Filter {
	
	private static Log log = LogFactory.getLog(UuidFilter.class);
	
	@Override
	protected boolean accept(HttpServletRequest request) {
		// TODO Auto-generated method stub
		MyContext context = MyContextProvider.getMyContext();
		String uuid = context.getUuid();
		boolean accept = super.getTable().accept(uuid);
		if(!accept && log.isDebugEnabled()){
			log.debug("uuid禁止访问：" + uuid);
		}
		return accept;
	}

}
